package com.lb.shopguide.base;

import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;

import com.blankj.utilcode.util.ToastUtils;
import com.jaeger.library.StatusBarUtil;
import com.lb.shopguide.ui.fragment.FragmentGuide;
import com.lb.shopguide.ui.fragment.guide.pay.FragmentMyMoney;
import com.tendcloud.tenddata.TCAgent;

public abstract class BaseCommonFragment extends BaseFragment {

    @Override
    public void onSupportVisible() {
        super.onSupportVisible();
        TCAgent.onPageStart(_mActivity, getPageTag());
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            if (this instanceof FragmentGuide || this instanceof FragmentMyMoney) {
                StatusBarUtil.setColor(_mActivity, Color.rgb(253, 91, 89), 0);
                StatusBarUtil.setDarkMode(_mActivity);
            } else {
                StatusBarUtil.setColor(_mActivity, Color.rgb(255, 255, 255), 0);
                StatusBarUtil.setLightMode(_mActivity);
            }
        }
    }

    @Override
    public void onSupportInvisible() {
        super.onSupportInvisible();
        TCAgent.onPageEnd(_mActivity, getPageTag());
    }

    @Override
    public void onEnterAnimationEnd(Bundle savedInstanceState) {
        initData();
        initView();
    }

}
